#include<bits/stdc++.h>
using namespace std;
int a[200005];
int main(){
    freopen("arena.in","r",stdin);
    freopen("arena.out","w",stdout);
    ios::sync_with_stdio(0);
    int n,m;int t=0;
    cin>>n>>m;
    for(int i=1;i<=n;i++){
            cin>>a[i];
    }
    for(int i=1;i<=m;i++){
            cin>>a[i];
        }
    cin>>t;

    while(t--){
        cout<<0<<endl;
    }
    return 0;
}
